package com.guns.dome1.web;


import com.guns.dome1.service.IDeptService;
import com.guns.dome1.vo.req.ReqDeptVo;
import com.guns.dome1.vo.resp.RespBaseVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/dept")
public class DeptControler {


    //逻辑层接口
    @Autowired
    private IDeptService iDeptService;

    //增加部门
    @ResponseBody
    @RequestMapping(value = "/add")
    public RespBaseVo add(@RequestBody ReqDeptVo reqDeptVo) {
        return iDeptService.add(reqDeptVo);
    }
    //查询部门

    @ResponseBody
    @RequestMapping(value = "/list")
    public RespBaseVo list(@RequestBody ReqDeptVo reqDeptVo) {
        return iDeptService.list(reqDeptVo);
    }


    //修改部门
    @ResponseBody
    @RequestMapping(value = "/edit")
    public RespBaseVo edit(@RequestBody ReqDeptVo reqDeptVo) {
        return iDeptService.edit(reqDeptVo);
    }

    //删除部门
    @ResponseBody
    @RequestMapping(value = "/del")
    public RespBaseVo del(@RequestBody ReqDeptVo reqDeptVo) {
        return iDeptService.del(reqDeptVo);
    }


}
